package com.Tjise.JAVAzuoye1;

public class Rectsngle extends Shape{
    int width;
    int height;


    @Override
    public double getArea() {
        return width*height;
    }

    @Override
    public double getPer() {
        return (width+height)*2;
    }

    @Override
    public String toString() {
        return "矩形的周长是："+getPer()+",矩形的面积是："+getArea()+"，颜色是："+getColor();
    }

    public Rectsngle() {
    }

    public Rectsngle(String color, int width, int height) {
        super(color);
        this.width = width;
        this.height = height;
    }
}
